package uk.ac.glasgow.demosocs.impl;

import uk.ac.glasgow.demosocs.Candidate;
import uk.ac.glasgow.demosocs.users.User;

/**
 * The Class CandidateStub.
 * 
 * @author Project Team L
 */
public class CandidateStub implements Candidate {

	/** The candidate surname. */
	private String candidateSurname;
	
	/** The candidate forename. */
	private String candidateForename;
	
	/** The GUID. */
	private String GUID;
	
	/** The accepted nomination. */
	private boolean acceptedNomination = false;
	
	
	/**
	 * Instantiates a new candidate stub.
	 *
	 * @param candidate the candidate
	 */
	public CandidateStub(Candidate candidate){
		this.candidateForename = candidate.getCandidateForename();
		this.candidateSurname = candidate.getCandidateSurname();
		this.GUID = candidate.getGUID();		
	}
	
	/**
	 * Instantiates a new candidate stub.
	 *
	 * @param surname the surname
	 * @param forename the forename
	 * @param GUID the gUID
	 */
	public CandidateStub(String surname, String forename, String GUID){
		this.candidateForename = forename;
		this.candidateSurname = surname;
		this.GUID = GUID;
	}
	
	/**
	 * Instantiates a new candidate stub.
	 *
	 * @param user the user
	 */
	public CandidateStub(User user){
		this.candidateForename = user.getForename();
		this.candidateSurname = user.getSurname();
		this.GUID = user.getGUID();
	}
	
	/**
	 * Gets the GUID of this Candidate.
	 * 
	 * @return String representing GUID.
	 */
	@Override
	public String getGUID() {
		return this.GUID;
	}

	/**
	 * Gets the surname of this Candidate.
	 * 
	 * @return String representing surname.
	 */
	@Override
	public String getCandidateSurname() {
		return this.candidateSurname;
	}
	
	/**
	 * Gets the forename of this Candidate.
	 * 
	 * @return String representing forename.
	 */
	@Override
	public String getCandidateForename() {
		return this.candidateForename;
	}
	
	/**
	 * Sets the gUID.
	 *
	 * @param guid the new gUID
	 */
	public void setGUID(String guid){
		this.GUID = guid;		
	}
	
	/**
	 * Sets the candidate surname.
	 *
	 * @param surname the new candidate surname
	 */
	public void setCandidateSurname(String surname){
		this.candidateSurname = surname;
	}
	
	/**
	 * Sets the candidate forename.
	 *
	 * @param forename the new candidate forename
	 */
	public void setCandidateForename(String forename){
		this.candidateForename = forename;
	}

	/**
	 * Checks for accepted nomanination.
	 *
	 * @return true, if successful
	 */
	public boolean hasAcceptedNomanination(){
		return this.acceptedNomination;
	}
	
	/**
	 * Sets the accepted nomination.
	 */
	public void setAcceptedNomination(){
		this.acceptedNomination = true;
	}
	
	public String toString(){
		return this.candidateSurname + " " + this.candidateForename + " " + this.GUID;
	}
	
}
